<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>人气推荐</title>
	<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/mui.min.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/all.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/app.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/app.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/font/iconfont.css">
	<link rel="stylesheet" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/swiper/css/swiper.min.css">
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/ydui.css?rev=@@hash" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/dropload.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/tcindex.css?">
</head>
<style type="text/css">
	.seckill{border-top: 1px solid #eee;}
	.hotselling .list-price{font-size: 18px}
	.list-price em{font-size: 12px;}
	.rcmdPrdList dl{position: relative;}
	.rcmdPrdList dl i.iconfont{color:#e54242;position:absolute;bottom: 3px;right:5px;font-size: 18pt}
	.rcmdPrdList dl .x{position: absolute;top: 2.5px;right:2.5px;z-index: 9;width: 30px;height: 30px;}
	.PrdLineStyle dd{width: calc(100% - 30vw - 10px);float: right;}
	.gpPrd li .x{position: absolute;right: 0;top: 0;width: 30px;height: 30px;}
	.hotselling .besthot .bestlist .rob {
    display: block;
}
</style>
<body>
<div class="hotselling popularity">
	<div class="swiper-container">
		<div class="swiper-wrapper" id="slide">
			{{range .ad}}
			<div class="swiper-slide goto" href="{{.url}}" style="background-image: url({{.pathname}});"></div>
			{{end}}
		</div>
		<div class="swiper-pagination"></div>
	</div>
	<div class="seckill">
		<h1>
			<span>人气推荐</span>
			<!-- <a class="fr" href="">更多</a> -->
		</h1>
		<div class="gpPrd">
			<ul style="width: calc(28vw * 5 + 10px);">
				{{range .rinfo}}
				<li>
					<a href="/mobile/column/product_content?id={{.id}}">
						<p><img src="{{.pathname}}" alt=""></p>
						<p>{{.title}}</p>
						<p>
							{{if .vprice}}
							<span>&yen; {{.vprice}}</span><s>&yen; {{.price}}</s>
							{{else}}
							<span>&yen; {{.price}}</span>
							{{end}}
						</p>
					</a>
					{{if eq .active 1}}
					<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/gbuy.png" class="x">
					{{else if eq .active 2}}
					<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/sales.png" class="x">
					{{end}}
				</li>
				{{end}}
			</ul>
		</div>
	</div>
	<div class="besthot mt-10">
		<a href="/mobile/column/product_content?id={{.finfo.id}}">
			<span class="tag">Fire</span>
			<dl><img src="{{.finfo.pathname}}"></dl>
			<div class="bestlist">
				<h1 class="overpl2">{{.finfo.title}}</h1>
				<p class="overpl2 mt-5">{{.finfo.description}}</p>
				<p class="mt-5"><span class="list-price"><em>¥</em> {{if .finfo.vprice}}{{.finfo.vprice}}{{else}}{{.finfo.price}}{{end}}</span></p>
				<div class="rob mt-5 goto" href="/mobile/column/product_content?id={{.finfo.id}}">
					<span>今日人气王</span>
					<em>马上抢</em>
				</div>
			</div>
		</a>
	</div>
	<div class="seckill mt-10 dadyseckill">
		<h1>
			<span>每日推荐</span>
			<!-- <a class="fr" href="">更多</a> -->
		</h1>
		<div class="gpPrd">
			<ul style="width: calc(28vw * 6 + 10px);">
				{{range .minfo}}
				<li>
					<a href="/mobile/column/product_content?id={{.id}}">
						<p><img src="{{.pathname}}" alt=""></p>
						<p>{{.title}}</p>
						<p>
							{{if .vprice}}
							<span>&yen; {{.vprice}}</span><s>&yen; {{.price}}</s>
							{{else}}
							<span>&yen; {{.price}}</span>
							{{end}}
						</p>
					</a>
					{{if eq .active 1}}
					<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/gbuy.png" class="x">
					{{else if eq .active 2}}
					<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/sales.png" class="x">
					{{end}}
				</li>
				{{end}}
			</ul>
		</div>
	</div>
	<div class="rcmdHd"><span>其他推荐</span></div>
	<div class="rcmdPrdList">
		{{range .info}}
		<dl class="goto">
			<dt class="goto" href="/mobile/column/product_content?id={{.id}}">
				<img src="{{.pathname}}" alt="">
			</dt>
			<dd>
				<p>{{.title}}</p>
				<p>
					{{if .vprice}}
					<span>&yen; {{.vprice}}</span><s>&yen; {{.price}}</s>
					{{else}}
					<span>&yen; {{.price}}</span>
					{{end}}
				</p>
				<p>好评率{{.hp}}%</p>
			</dd>
			<i class="iconfont scadd" data-id="{{.id}}" >&#xe619;</i>
			{{if eq .active 1}}
			<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/gbuy.png" class="x">
			{{else if eq .active 2}}
			<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/sales.png" class="x">
			{{end}}
		</dl>
		{{end}}
	</div>
</div>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/other/app.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/sui/js/SUI.js"></script>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/swiper/js/swiper.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/zepto.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/dropload.min.js"></script>
<div class="mt-statistics">统计代码</div>
{{template "wechat/public/share.html" .}}
<script>
	var swiper = new Swiper('.swiper-container', {
		pagination: '.swiper-pagination',
		paginationClickable: true,
		loop:true,
		autoplay:3500
	});
	mui('body').on('tap','.goto',function(){
		var h=this.getAttribute("href")
		if(h){window.location.href=h }
	})
	var page=3;
	$('.element').dropload({
    scrollArea : window,
    threshold: 2,
    loadDownFn : function(me){
        $.ajax({
            type: 'GET',
            url: window.location.href,
            dataType: 'json',
            data:{page:page},
            success: function(data){
   			   var res=data.info
               page+=1
              if(res){
                 for (var i=0;i<res.length;i++){
                    var dl = document.createElement('dl');
                    dl.className="goto"	
 					var	html=`<dt class="goto" href="/mobile/column/product_content?id=`+res[i].id+`"><img src="`+res[i].pathname+`" alt=""></dt>
					<dd><p>`+res[i].title+`</p><p>`
					if(res[i].vprice){
						html+=`<span>&yen; `+res[i].vprice+`</span><s>&yen;`+res[i].price+`</s>`
					}else{
						html+=`<span>&yen; `+res[i].price+`</span>`
					}
					html+=`</p>
					<p>好评率`+res[i].hp+`%</p></dd><i class="iconfont scadd" data-id="`+res[i].id+'" >&#xe619;</i>'
					if (res[i].active==1){
						html+='<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/gbuy.png" class="x">'
					}else if(res[i].active==2){
						html+='<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/sales.png" class="x">'
					}
                    dl.innerHTML=html
                    document.getElementsByClassName('rcmdPrdList')[0].appendChild(dl)
                }
                me.resetload();
                }else{
                    mui.toast("没有更多了！");
                    $(".dropload-down").remove();
                }
            },
            error: function(xhr, type){
                mui.toast("网络慢，请重新刷新!");
                me.resetload();
            }
        });
    }
});
function stopPropagation(e) {  
    if (e.stopPropagation) {  
        e.stopPropagation();  
    } else {  
        e.cancelBubble = true;  
    }  
}  
mui('body').on('click','.scadd',function(e){
	stopPropagation(e)
	var pid=this.getAttribute("data-id")
	var data={num:1,pid:pid}
	mui.post('/mobile/shopcar',data,function(res){
		if(res==2||res==962){
			mui.confirm("您还未登入,请先登入","提示",function(res){
				if(res.index){
					mui.closePopups()
					window.location.href="/mobile/login"
				}
			})
		}else if(res==1){
			mui.toast("添加成功~")
		}else if(res==0){
			mui.toast("网络繁忙,请重试!")
		}else if(res==3){
          mui.toast('库存不足');
        }
	})
})
</script> 
</body>
</html>